﻿using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using DDCMS.EntityFrameworkCore;

namespace DDCMS.Migrations
{
    [DbContext(typeof(CMSContext))]
    partial class CMSContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.0.0-rtm-21431");

            modelBuilder.Entity("DDCMS.Domain.Manager.Category", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("CascadeId");

                    b.Property<string>("Name");

                    b.Property<int?>("ParentId");

                    b.Property<string>("RootKey");

                    b.Property<string>("RootName");

                    b.Property<int>("SortNo");

                    b.Property<int>("Status");

                    b.HasKey("Id");

                    b.ToTable("Category");
                });

            modelBuilder.Entity("DDCMS.Domain.Manager.CommonApply", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<DateTime>("ApplyTime");

                    b.Property<string>("Comment");

                    b.Property<int?>("ControllerUserId");

                    b.Property<string>("Name");

                    b.Property<int>("Sort");

                    b.Property<string>("State");

                    b.Property<string>("StateName");

                    b.Property<Guid>("UserId");

                    b.HasKey("Id");

                    b.ToTable("CommonApply");
                });

            modelBuilder.Entity("DDCMS.Domain.Manager.DicDetail", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Description");

                    b.Property<int>("DicId");

                    b.Property<int>("SortNo");

                    b.Property<int>("Status");

                    b.Property<string>("Text");

                    b.Property<string>("Value");

                    b.HasKey("Id");

                    b.ToTable("DicDetail");
                });

            modelBuilder.Entity("DDCMS.Domain.Manager.DicIndex", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<int?>("CategoryId");

                    b.Property<string>("Description");

                    b.Property<string>("Key");

                    b.Property<string>("Name");

                    b.Property<int>("SortNo");

                    b.HasKey("Id");

                    b.ToTable("DicIndex");
                });

            modelBuilder.Entity("DDCMS.Domain.Manager.Module", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("CascadeId");

                    b.Property<string>("HotKey");

                    b.Property<string>("IconName");

                    b.Property<bool>("IsAutoExpand");

                    b.Property<bool>("IsLeaf");

                    b.Property<string>("Name");

                    b.Property<int?>("ParentId");

                    b.Property<string>("ParentName");

                    b.Property<int>("SortNo");

                    b.Property<int>("Status");

                    b.Property<string>("Url");

                    b.Property<string>("Vector");

                    b.HasKey("Id");

                    b.ToTable("Module");
                });

            modelBuilder.Entity("DDCMS.Domain.Manager.ModuleElement", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Attr");

                    b.Property<string>("Class");

                    b.Property<string>("DomId");

                    b.Property<string>("Icon");

                    b.Property<int>("ModuleId");

                    b.Property<string>("Name");

                    b.Property<string>("Remark");

                    b.Property<string>("Script");

                    b.Property<int>("Sort");

                    b.Property<string>("Type");

                    b.HasKey("Id");

                    b.ToTable("ModuleElement");
                });

            modelBuilder.Entity("DDCMS.Domain.Manager.Org", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("BizCode");

                    b.Property<string>("CascadeId");

                    b.Property<int>("CreateId");

                    b.Property<DateTime>("CreateTime");

                    b.Property<string>("CustomCode");

                    b.Property<string>("HotKey");

                    b.Property<string>("IconName");

                    b.Property<bool>("IsAutoExpand");

                    b.Property<bool>("IsLeaf");

                    b.Property<string>("Name");

                    b.Property<int?>("ParentId");

                    b.Property<string>("ParentName");

                    b.Property<int>("SortNo");

                    b.Property<int>("Status");

                    b.Property<int>("Type");

                    b.HasKey("Id");

                    b.ToTable("Org");
                });

            modelBuilder.Entity("DDCMS.Domain.Manager.Relevance", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Description");

                    b.Property<int>("FirstId");

                    b.Property<string>("Key");

                    b.Property<DateTime>("OperateTime");

                    b.Property<int>("OperatorId");

                    b.Property<int>("SecondId");

                    b.Property<int>("Status");

                    b.HasKey("Id");

                    b.ToTable("Relevance");
                });

            modelBuilder.Entity("DDCMS.Domain.Manager.Resource", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("CascadeId");

                    b.Property<Guid?>("CategoryId");

                    b.Property<string>("Description");

                    b.Property<string>("Key");

                    b.Property<string>("Name");

                    b.Property<int?>("ParentId");

                    b.Property<int>("SortNo");

                    b.Property<int>("Status");

                    b.HasKey("Id");

                    b.ToTable("Resource");
                });

            modelBuilder.Entity("DDCMS.Domain.Manager.User", b =>
                {
                    b.Property<string>("Id");

                    b.Property<int>("AccessFailedCount");

                    b.Property<string>("Account");

                    b.Property<string>("BizCode");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken();

                    b.Property<int?>("CrateId");

                    b.Property<DateTime>("CreateTime");

                    b.Property<string>("Email")
                        .HasAnnotation("MaxLength", 256);

                    b.Property<bool>("EmailConfirmed");

                    b.Property<bool>("LockoutEnabled");

                    b.Property<DateTimeOffset?>("LockoutEnd");

                    b.Property<string>("Name");

                    b.Property<string>("NormalizedEmail")
                        .HasAnnotation("MaxLength", 256);

                    b.Property<string>("NormalizedUserName")
                        .HasAnnotation("MaxLength", 256);

                    b.Property<string>("Password");

                    b.Property<string>("PasswordHash");

                    b.Property<string>("PhoneNumber");

                    b.Property<bool>("PhoneNumberConfirmed");

                    b.Property<string>("SecurityStamp");

                    b.Property<int>("Sex");

                    b.Property<int>("Status");

                    b.Property<bool>("TwoFactorEnabled");

                    b.Property<int>("Type");

                    b.Property<string>("UserName")
                        .HasAnnotation("MaxLength", 256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasName("UserNameIndex");

                    b.ToTable("AspNetUsers");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b =>
                {
                    b.Property<string>("Id");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken();

                    b.Property<string>("Discriminator")
                        .IsRequired();

                    b.Property<string>("Name")
                        .HasAnnotation("MaxLength", 256);

                    b.Property<string>("NormalizedName")
                        .HasAnnotation("MaxLength", 256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .HasName("RoleNameIndex");

                    b.ToTable("AspNetRoles");

                    b.HasDiscriminator<string>("Discriminator").HasValue("IdentityRole");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("ClaimType");

                    b.Property<string>("ClaimValue");

                    b.Property<string>("RoleId")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("ClaimType");

                    b.Property<string>("ClaimValue");

                    b.Property<string>("UserId")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider");

                    b.Property<string>("ProviderKey");

                    b.Property<string>("ProviderDisplayName");

                    b.Property<string>("UserId")
                        .IsRequired();

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId");

                    b.Property<string>("RoleId");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId");

                    b.Property<string>("LoginProvider");

                    b.Property<string>("Name");

                    b.Property<string>("Value");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens");
                });

            modelBuilder.Entity("DDCMS.Domain.Manager.Role", b =>
                {
                    b.HasBaseType("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole");

                    b.Property<string>("CreateId");

                    b.Property<DateTime>("CreateTime");

                    b.Property<int>("Status");

                    b.Property<int>("Type");

                    b.ToTable("Role");

                    b.HasDiscriminator().HasValue("Role");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
                        .WithMany("Claims")
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("DDCMS.Domain.Manager.User")
                        .WithMany("Claims")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("DDCMS.Domain.Manager.User")
                        .WithMany("Logins")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
                        .WithMany("Users")
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("DDCMS.Domain.Manager.User")
                        .WithMany("Roles")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });
        }
    }
}
